package com.shaw.client.mvc.goal;

import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.mvc.AppEvent;
import com.extjs.gxt.ui.client.mvc.Controller;
import com.extjs.gxt.ui.client.mvc.View;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.shaw.client.model.ui.AppMainUI;
import com.shaw.client.mvc.AppEvents;
import com.shaw.client.mvc.AppView;
import com.shaw.client.mvc.widgt.ContactPanel;



public class ContactView extends View {

	  private ContactPanel panel;

	  public ContactView(Controller controller) {
	    super(controller);
	  }

	  @Override
	  protected void initialize() {
	    panel = new ContactPanel();
	  }

	  @Override
	  protected void handleEvent(AppEvent event) {
	    if (event.getType() == AppEvents.NavContacts) {
	    	 LayoutContainer wrapper = ((AppMainUI) Registry.get(AppView.DESKTOP)).getCenter();
	      wrapper.removeAll();
	      wrapper.add(panel);
	      wrapper.layout();
	    }
	  }

	}
